<template>
    <div class="bread">
        <div>
            <el-breadcrumb separator="|" style="vertical-align: middle;line-height: 60px;">
                <!--<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>-->
                <el-breadcrumb-item v-for="(item, index) in breadList" :key="index" :to="{ path: item.path }">{{
                    item.meta.title }}
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
    </div>
</template>

<script>
    export default {
        name: "bread",
        data() {
            return {
                breadList: [],
            }
        },
        methods: {
            isHome(route) {
                return route.name === "首页";
            },
            getBreadcrumb() {
                let matched = this.$route.matched;
                this.breadList = matched;
            },

        },
        watch: {
            $route() {
                this.getBreadcrumb();
            },
        },
        created() {
            this.getBreadcrumb();
        },
    }
</script>

<style scoped>

</style>